<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 先请求A,再请求B,再请求C
        function* grn(){
            console.log('请求A数据');
            yield setTimeout(() => {
                console.log('A数据');
                gn.next()
            }, 1000);

            console.log('请求B数据');
            yield setTimeout(() => {
                console.log('B数据');
                gn.next()
            }, 1000);

            console.log('请求c数据');
            yield setTimeout(() => {
                console.log('c数据');

            }, 1000);
        }
        const gn= grn()
        gn.next()
    </script>
</body>
</html>